Don't get stuck in a recursive mainloop if a synchronous preview is
authorMatthias Clasen <mclasen@redhat.com>
Mon, 30 Apr 2007 02:47:41 +0000 (02:47 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 30 Apr 2007 02:47:41 +0000 (02:47 +0000)
2007-04-29  Matthias Clasen <mclasen@redhat.com>

        * gtk/gtkprintoperation.c (print_pages_idle): Don't get
        stuck in a recursive mainloop if a synchronous preview
        is cancelled.

svn path=/trunk/; revision=17721

ChangeLog
gtk/gtkprintoperation.c

index eb0cab4e000ef604efff09342b96a89064c3739f..7178af325c921a0370c805c6b6c9c2b1f6c14665 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-04-29  Matthias Clasen <mclasen@redhat.com>
+
+       * gtk/gtkprintoperation.c (print_pages_idle): Don't get
+       stuck in a recursive mainloop if a synchronous preview
+       is cancelled.
+
 2007-04-29  Matthias Clasen <mclasen@redhat.com>
 
        Make the emission of ::end-print and ::done consistent
@@ -10,7 +16,7 @@
        (print_pages_idle): If a preview has been cancelled, don't
        emit ::ready, but emit ::end-print. 
 
-       tests/print-editor.c: Use ::end-print to undo allocations
+       tests/print-editor.c: Use ::end-print to undo allocations
        from ::begin-print.
 
 2007-04-29  Matthias Clasen <mclasen@redhat.com>
index ff6a879ca39a680bcef184757f5a9651b08545f5..ed038152c77b12f78094efdb9238ca7f64ed9d2e 100644 (file)
@@ -1928,7 +1928,7 @@ print_pages_idle_done (gpointer user_data)
   if (priv->rloop && !data->is_preview) 
     g_main_loop_quit (priv->rloop);
 
-  if (!data->is_preview || priv->cancelled)
+  if (!data->is_preview)
     g_signal_emit (data->op, signals[DONE], 0,
                   priv->cancelled ?
                   GTK_PRINT_OPERATION_RESULT_CANCEL :
@@ -2143,10 +2143,11 @@ print_pages_idle (gpointer user_data)
     {
       _gtk_print_operation_set_status (data->op, GTK_PRINT_STATUS_FINISHED_ABORTED, NULL);
       
+      data->is_preview = FALSE;
       done = TRUE;
     }
 
-  if (done && (!data->is_preview || priv->cancelled))
+  if (done && !data->is_preview)
     {
       g_signal_emit (data->op, signals[END_PRINT], 0, priv->print_context);
       priv->end_run (data->op, priv->is_sync, priv->cancelled);